from rest_framework import serializers
# 这里导入在视图没有导入这里之前没有问题, 在导入之后必须要使用相对导入了. 具体不知道为什么
# from luffyapi.apps.home import models
# from apps.home import models
from . import models
'''
RuntimeError: Model class luffyapi.apps.home.models.Banner doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
'''


class BannerModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Banner
        fields = ('name', 'link', 'image')
